package leetcode.weekly.week316;

//Solution1Test
public class Solution1 {

	public boolean haveConflict(String[] event1, String[] event2) {
		int[] t1 = this.f(event1);
		int[] t2 = this.f(event2);
		if (Math.max(t1[0], t2[0]) <= Math.min(t1[1], t2[1])) {
			return true;
		}
		return false;
	}

	private int[] f(String[] event1) {
		return new int[] { this.ff(event1[0]), this.ff(event1[1]) };
	}

	private int ff(String string) {
		String[] st = string.split(":");
		return Integer.valueOf(st[0]) * 60 + Integer.valueOf(st[1]);
	}
}
